import { LOCATION_UPDATE } from './../constants/location';
const INITIAL_STATE = {
  wxLocation: {
    accuracy: 0,
    altitude: 0,
    horizontalAccuracy: 0,
    latitude: 0,
    longitude: 0,
    speed: 0,
    verticalAccuracy: 0,
    errMsg: ''
  }
}

export default (state = INITIAL_STATE, action) => {
  switch(action.type) {
    case LOCATION_UPDATE:
      return{
        ...state,
        wxLocation: action.wxLocation
      }
      break
    default:
      return state
      break
  }
}